A few NEW_STRING scragglers from an old work tree.
authorrobertlipe <robertlipe@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Thu, 10 Apr 2014 01:52:37 +0000 (01:52 +0000)
committerrobertlipe <robertlipe@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Thu, 10 Apr 2014 01:52:37 +0000 (01:52 +0000)
git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@4798 f51c46e8-681c-474f-0cfe-069cfd0219fb

gpsbabel/compegps.cc
gpsbabel/garmin.cc
gpsbabel/google.cc
gpsbabel/ozi.cc
gpsbabel/stmsdf.cc

index 77a2eea04c2b1991cc438cffd4f972f5481c85de..3bd13be38ad79e4f56c46ecedf139f31d5091c98 100644 (file)
@@ -486,8 +486,7 @@ write_waypt_cb(const Waypoint* wpt)
   if (curr_index != target_index) {
     return;
   }
-// NEW_STRING: remove extra ctor below.
-  name = (snlen > 0) ? mkshort_from_wpt(sh, wpt) : csv_stringclean(QString(wpt->shortname), " ");
+  name = (snlen > 0) ? mkshort_from_wpt(sh, wpt) : csv_stringclean(wpt->shortname, " ");
 
   gbfprintf(fout, "W  %s A ", CSTR(name));
   gbfprintf(fout, "%.10f%c%c ",
@@ -590,8 +589,7 @@ write_trkpt_cb(const Waypoint* wpt)
   if (track_info_flag != 0) {
     track_info_flag = 0;
     if (curr_track->rte_name != NULL) {
-// NEW_STRING: remove extra ctor below.
-      QString name = csv_stringclean(QString(curr_track->rte_name), "|");
+      QString name = csv_stringclean(curr_track->rte_name, "|");
       gbfprintf(fout, "t 4294967295|%s|-1|-1\n", CSTR(name));
     }
   }
index a77a0233e5adb5b5480d2b5e71def14594790d9d..e005f553cf1ed89699e5ed4a9004d8c6bb322ca3 100644 (file)
@@ -1082,20 +1082,12 @@ route_waypt_pr(const Waypoint* wpt)
   }
 
   rte->ident[sizeof(rte->ident)-1] = 0;
-#if NEW_STRINGS
   if (wpt->description.isEmpty()) {
-    strncpy(rte->cmnt, CSTR(wpt->description), sizeof(rte->cmnt));
-    rte->cmnt[sizeof(rte->cmnt)-1] = 0;
+    rte->cmnt[0] = 0;
   } else {
-  }
-#else
-  if (wpt->description) {
-    strncpy(rte->cmnt, wpt->description, sizeof(rte->cmnt));
+    strncpy(rte->cmnt, CSTR(wpt->description), sizeof(rte->cmnt));
     rte->cmnt[sizeof(rte->cmnt)-1] = 0;
-  } else  {
-    rte->cmnt[0] = 0;
   }
-#endif
   cur_tx_routelist_entry++;
 }
 
index de975cc4c51a5ce944029206d71f38c30bbb6a73..cd196b2834cfafe1e985b8320639d04953fbe5e9 100644 (file)
@@ -231,15 +231,7 @@ void goog_poly_e(xg_string args, const QXmlStreamAttributes*)
       wpt_tmp->latitude = lat / 100000.0;
       wpt_tmp->longitude = lon / 100000.0;
       wpt_tmp->route_priority=level;
-// NEW_STRINGS FIXME(robertlipe): this is broken somehow there should be no need
-// to overallocate like this, but it's needed ot get an1 to not scribble
-// on itself.
-#if NEW_STRINGS
       wpt_tmp->shortname = QString().sprintf( "\\%5.5x", serial++);
-#else
-      wpt_tmp->shortname = (char*) xmalloc(7);
-      sprintf(wpt_tmp->shortname, "\\%5.5x", serial++);
-#endif
       route_add_wpt(routehead[goog_segroute], wpt_tmp);
     }
   }
index 79a7314ab89057698a86f8a8d065cddde3a8ef24..37dabc697d1897dc65334045e83b13f11550e2f6 100644 (file)
@@ -649,7 +649,7 @@ ozi_parse_routepoint(int field, char* str, Waypoint* wpt_tmp)
     break;
   case 4:
     /* waypoint name */
-    wpt_tmp->shortname = csv_stringclean(str, QString(","));
+    wpt_tmp->shortname = csv_stringclean(str, ",");
     break;
   case 5:
     /* latitude */
@@ -680,7 +680,7 @@ ozi_parse_routepoint(int field, char* str, Waypoint* wpt_tmp)
     break;
   case 13:
     /* description */
-    wpt_tmp->description = csv_stringclean(str, QString(","));
+    wpt_tmp->description = csv_stringclean(str, ",");
     break;
   default:
     break;
index 3a0e4148d404582194dc4d6fe60f2a56d9227d17..25fada8a48c725dd734f1b48b8a7ecfe7768cb33 100644 (file)
@@ -272,7 +272,7 @@ parse_point(char* line)
       break;
 
     case 1:
-      wpt->shortname = csv_stringclean(str, QString("\""));
+      wpt->shortname = csv_stringclean(str, "\"");
       if ((what == 2) || (what == 3)) {
         column += 2;  /* doesn't have date and time */
       }